package jp.joogoo.web.service;

import jp.joogoo.web.model.M_service;

public final class FetcherServiceFactory {
    /**
     * 新着情報を取得するインスタンスを生成します。
     * 
     * @param service
     * @return new instance which fetches notification data.
     */
    public static FetcherService createFetcher(M_service service) {
        String serviceName = service.getServiceName();
        if ("サイボウズLive".equals(serviceName)) {
            return new CybozuliveFetcher();
        } else if ("youRoom".equals(serviceName)) {
            return new YouroomFetcher();
        } else {
            throw new RuntimeException("Unknown service name: " + serviceName);
        }
    }
}
